#pragma once
#include "afxwin.h"


// PreserveSet dialog

class CGridCtrl;
class PreserveSet : public CDialog
{
	DECLARE_DYNAMIC(PreserveSet)

public:
	PreserveSet(CWnd* pParent = NULL);   // standard constructor
	virtual ~PreserveSet();

// Dialog Data
	enum { IDD = IDD_PRESERVESET };

	void initialTimeInterval(const vector<timeInterval>& timeInt){m_timeInterval = timeInt;}
	void initialDay(unsigned int day){m_preserveDay = day;};
	void initialMore(const vector<CString>& more){ m_vMore = more;}
	void initialWaitTime(UINT wait){m_nWaitTime = wait;}
	void initialChangeStateTime(UINT change){m_ChangeStateTime = change;}
	
	unsigned int getDay()const{return m_preserveDay;} 
	const vector<timeInterval>& getTimeInterval()const{return m_timeInterval;}
	const vector<CString>& getMore()const{return m_vMore;}
	unsigned int  getWaitTime()const {return m_nWaitTime ;}
	unsigned int  getChangeStateTime()const{return m_ChangeStateTime ;}
protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	CGridCtrl* m_timeTable;

	DECLARE_MESSAGE_MAP()
public:
	virtual BOOL OnInitDialog();
public:
	afx_msg void OnBnClickedAddtime();
private:
	vector<timeInterval> m_timeInterval;
	vector<CString>  m_vMore;
	UINT m_preserveDay;
	afx_msg void OnBnClickedDeltime();
	CListBox m_more;
	afx_msg void OnBnClickedAddmore();
	afx_msg void OnBnClickedDelmore();
	afx_msg void OnBnClickedEditmore();
	UINT m_nWaitTime;
	UINT m_ChangeStateTime;
};
